<template>
	<view>
		<view class="comment-list">
			<view class="item-comment" v-for="(item,index) in list" :key="index">
				<image class="comment-header" :src="item.avatar" mode=""></image>
				<view class="right-info">
					<view class="user-name">
						{{item.nickname}}
					</view>
					<view class="start-time">
						<uni-rate :disabled="true" size="14" disabledColor="#E7533F" :value="item.star" />
						<view class="time">{{item.create_time}}</view>
					</view>
					<view class="subscribe-info">
						<image class="technician-header" :src="item.technician_image" mode=""></image>
						<view class="technician-name">{{item.real_name}}</view>
						<view class="lines"></view>
						<view class="technician-service">{{item.service_name}}</view>
						<!-- <view class="yue-btn" @click="toTen(item)">约Ta</view> -->
					</view>
					<view class="address-zan" v-if="item.province !='undefined' && item.province">
						<view>{{item.province}} {{item.city}}</view>
					</view>
				</view>
			</view>
		</view>
		<!-- <blankPage img="https://qiniu-cdn.maeiyun.com/imgs/blank/no_order.png" text="暂无记录" :width="161" :height="129" v-show="list.length == 0"></blankPage> -->
	</view>
</template>

<script>
	export default {
			data() {
				return {
					list:[],
					page:1,
					total:0,
					id:""
				}
			},
			onPullDownRefresh() {
				this.page = 1
				this.list = []
				this.getList()
				uni.startPullDownRefresh();
			},
			methods: {
				getList(){
					this.request.httpTokenRequest({
						url: "service/getTechnicianAssess",
						method: "get"
					}, {
						id:this.id,
						page:this.page
					}).then(data => {
						if (data.code == 0) {
							this.total = data.data.total
							data.data.data.forEach(item=>{
								this.list.push(item)
							})
							uni.stopPullDownRefresh();
						}else {
							this.$util.msg(data.msg)
						}
					}, error => {})
				}
			},
			onLoad(option) {
				this.id = 43
				this.getList()
			},
			onReachBottom() {
				if(this.total > this.list.length){
					this.page ++ 
					this.getList()
				}
			}
	}
</script>

<style lang="scss">
	.comment-list{
		padding: 0 30rpx;
	}
	.item-comment{
		display: flex;
		align-items: flex-start;
		padding: 24rpx 0 ;
		border-bottom: 2rpx solid #E3E2E2;
		.comment-header{
			width: 81rpx;
			height: 81rpx;
			border-radius: 50%;
			flex: 0 0 auto;
		}
		.right-info{
			margin-left: 27rpx;
			flex: 1 0 auto;
			.start-time{
				display: flex;
				align-items: center;
				margin-top: 10rpx;
				image{
					width: 18rpx;
					height: 18rpx;
				}
				.time{
					margin-left: 12rpx;
					font-size: 20rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					color: #858688;
				}
			}
			.subscribe-info{
				display: flex;
				align-items: center;
				width: fit-content;
				height: 38rpx;
				background: #FFFFFF;
				border-radius: 19rpx;
				line-height: 38rpx;
				margin-top: 10rpx;
				font-size: 24rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #090B0B;
				padding-right: 20rpx;
				.technician-header{
					width: 34rpx;
					height: 34rpx;
					border-radius: 50%;
				}
				.technician-name{
					font-size: 24rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					color: #090B0B;
				}
				.technician-service{
					font-size: 24rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					color: #090B0B;
				}
				.lines{
					width: 1rpx;
					height: 24rpx;
					background-color: #BEBEBE;
					margin:  0 10rpx;
				}
				.yue-btn{
					width: 80rpx;
					height: 30rpx;
					background: #E7533F;
					border-radius: 19rpx;
					font-size: 20rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					color: #FFFFFF;
					line-height: 30rpx;
					text-align: center;
					margin-left: 6rpx;
				}
			}
			.address-zan{
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 20rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #858688;
				margin-top: 20rpx;
				.zan{
					display: flex;
					align-items: center;
					image{
						width: 25rpx;
						height: 24rpx;
						margin-right: 12rpx;
					}
				}
				
			}
		}
	}

</style>
